home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / dsp / dr.bub / 96000.lha / 96000 / appb / b133b.asm < prev    next >
Assembly Source File  |  1992-04-28  |  3KB  |  47 lines

  1. ; This program was originally published in the Motorola DSP96002 Users Manual
  2. ; and is provided under a DISCLAIMER OF WARRANTY available from Motorola DSP
  3. ; Operation, 6501 William Cannon Drive West, Austin, Texas 78735-8598.  For
  4. ; more information, refer to the DSP96002 Users Manual, Appendix B, DSP
  5. ; Benchmarks.
  6. ;
  7. ; B.1.33.2    Line Accept/Reject, floating-point Version  
  8. ;This determines if the line from (x0,y0,z0) to (x1,y1,z1) is within a  three-dimensional view cube.  If 
  9. ;the line is within the cube, the A  (accept) bit of the CCR will be set.  If the line is entirely outside of  
  10. ;the cube, then the R bit will be cleared.  If the line can not be  accepted or rejected, then further pro-
  11. ;cessing is required to clip the  line where it intersects with a boundary plane.  
  12. ;Registers: 
  13. ;   d0 = dimension  d4 = unused 
  14. ;   d1 = limit      d5 = unused 
  15. ;   d2 = unused     d6 = unused 
  16. ;   d3 = unused     d7 = unused 
  17. ;
  18. ;Memory Map: 
  19. ;               X Memory    Y Memory 
  20. ;(n0=3)  r0 ?   x0         Xmin  ? r4 
  21. ;                y0         Xmax 
  22. ;                z0         Ymin 
  23. ;                x1         Ymax 
  24. ;                y1         Zmin 
  25. ;                z1         Zmax 
  26. ;
  27. ;                                                            Program    ICycles 
  28. ;                                                              Words 
  29.   ori    #$e0,ccr         ;set accept/reject/overflow bits   1     1 
  30.   move         x:(r0)+n0,d0.s y:(r4)+,d1.s ;get x0,Xmin      1     1 
  31.   fcmp  d1,d0  x:(r0)-n0,d0.s              ;x0-Xmin, get x1  1     1 
  32.   fcmpg d1,d0                 y:(r4)+,d1.s ;x1-Xmin, Xmax    1     1 
  33.   fcmp  d0,d1  x:(r0)+,d0.s                ;Xmax-x1, get x0  1     1 
  34.   fcmpg d0,d1  x:(r0)+n0,d0.s y:(r4)+,d1.s ;Xmax-x0, y0,Ymin 1     1 
  35.   fcmp  d1,d0  x:(r0)-n0,d0.s              ;y0-Ymin, get y1  1     1 
  36.   fcmpg d1,d0                 y:(r4)+,d1.s ;y1-Ymin, Ymax    1     1 
  37.   fcmp  d0,d1  x:(r0)+,d0.s                ;Ymax-y1, get y0  1     1 
  38.   fcmpg d0,d1  x:(r0)+n0,d0.s y:(r4)+,d1.s ;Ymax-y0, z0,Zmin 1     1 
  39.   fcmp  d1,d0  x:(r0)-n0,d0.s              ;z0-Zmin, get z1  1     1 
  40.   fcmpg d1,d0                 y:(r4)+,d1.s ;z1-Zmin, Zmax    1     1 
  41.   fcmp  d0,d1  x:(r0),d0.s                 ;Zmax-z1, get z0  1     1 
  42.   fcmpg d0,d1                              ;Zmax-z0          1     1 
  43. ;                                                            ---   --- 
  44. ;                                                    Totals:  14    14 
  45.  
  46. ;If the A bit is set, the line can be accepted.  If the R bit is  cleared, the line can be rejected.  
  47.